package cn.smxy.client;

import cn.smxy.dto.CommentCountDto;
import cn.smxy.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "comment-service",path = "comment")
public interface CommentClient {
    /**
     * 删除对应用户的评论的接口
     * @param userId
     * @return
     */
    @DeleteMapping("/remove/{userId}")
    R removeById(@PathVariable Long userId);

    /**
     * 获取各作品评论数的接口
     * @return
     */
    @GetMapping("/count")
    List<CommentCountDto> getCount();

    /**
     * 删除对应作品评论的接口
     * @param plantId
     * @return
     */
    @DeleteMapping("/remove/works/{plantId}")
    R removeByPlantId(@PathVariable Long plantId);
}
